/*
 * CDPSBonusSet.java
 * 
 * Copyright (c) 2009 Giles Millward (Manigra). All rights reserved.
 * 
 * This file is part of Expression program is undefined on line 8, column 40 in Templates/Licenses/license-gplv3.txt..
 * 
 * Expression program is undefined on line 10, column 19 in Templates/Licenses/license-gplv3.txt. is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Expression program is undefined on line 15, column 19 in Templates/Licenses/license-gplv3.txt. is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Expression program is undefined on line 21, column 30 in Templates/Licenses/license-gplv3.txt..  If not, see <http://www.gnu.org/licenses/>.
 */

package dpsinterface;

import paperdoll.CPaperDoll;

/**
 *
 * @author Mani
 */
public class CDPSBonusSet {
    private boolean m_tier6_2pc = false;
    private boolean m_tier6_4pc = false;
    private boolean m_tier7_2pc = false;
    private boolean m_tier7_4pc = false;
    private boolean m_tier8_2pc = false;
    private boolean m_tier8_4pc = false;

    // 2 pieces: Increases the haste from your Slice and Dice ability by 5%.
    // 4 pieces: Increases the damage dealt by your Backstab, Sinister Strike, Mutilate, and Hemorrhage abilities by 6%.
    private int c_tier6_items[] = {31028,31026,31027,31029,31030,34575,34448,34558};

    // 2 pieces: Increases the damage dealt by your Rupture by 10%.
    // 4 pieces: Reduces the Energy cost of your Combo Moves by 5%.
    private int c_tier7_items[] = {
            39558,39560,39561,39564,39565, // Heroes
            40495,40496,40499,40500,40502 // Valorous
    };

    // 2 pieces: Your Deadly Poison causes you to gain 1 energy each time it deals damage.
    // 4 pieces: The damage dealt by your Rupture can now be critical strikes.
    private int c_tier8_items[] = {
        46123,46124,46125,46126,46127, // Conqueror's Terrorblade Battlegear
        45396,45397,45398,45399,45400  // Valorous Terrorblade Battlegear
    };

    public CDPSBonusSet(CPaperDoll p_paperDoll)
    {
        int l_totalItems;

        l_totalItems = countBonusSetPieces(p_paperDoll, c_tier6_items);
        if (l_totalItems > 1)
        {
            m_tier6_2pc = true;
        }

        if (l_totalItems > 3)
        {
            m_tier6_4pc = true;
        }

        l_totalItems = countBonusSetPieces(p_paperDoll, c_tier7_items);
        if (l_totalItems > 1)
        {
            m_tier7_2pc = true;
        }

        if (l_totalItems > 3)
        {
            m_tier7_4pc = true;
        }

        l_totalItems = countBonusSetPieces(p_paperDoll, c_tier8_items);
        if (l_totalItems > 1)
        {
            m_tier8_2pc = true;
        }

        if (l_totalItems > 3)
        {
            m_tier8_4pc = true;
        }
    }

    private int countBonusSetPieces(CPaperDoll p_paperDoll, int p_array[])
    {
        int l_totalItems = 0;
        for (int i = 0; i < p_array.length; i++)
        {
            if (p_paperDoll.isItemEquipped(p_array[i]))
            {
                l_totalItems ++;
            }
        }

        return l_totalItems;
    }

    /**
     * @return the m_tier6_2pc
     */
    public boolean isTier6_2pc() {
        return m_tier6_2pc;
    }

    /**
     * @return the m_tier6_4pc
     */
    public boolean isTier6_4pc() {
        return m_tier6_4pc;
    }

    /**
     * @return the m_tier7_2pc
     */
    public boolean isTier7_2pc() {
        return m_tier7_2pc;
    }

    /**
     * @return the m_tier7_4pc
     */
    public boolean isTier7_4pc() {
        return m_tier7_4pc;
    }

    /**
     * @return the m_tier8_2pc
     */
    public boolean isTier8_2pc() {
        return m_tier8_2pc;
    }

    /**
     * @return the m_tier8_4pc
     */
    public boolean isTier8_4pc() {
        return m_tier8_4pc;
    }
}
